<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>登录页</title>
<script src="${base}/scripts/validate/jquery.validate.js"
	type="text/javascript"></script>
<script src="${base}/scripts/validate/messages_cn.js"
	type="text/javascript"></script>
<script>
  			$(document).ready(function(){
    			$("#loginForm").validate();
    			$("#verifypic").click(function(){
					var dt = Math.random();
  					$('#verifypic').html("<img border=\"0\" src=\"/code.jpg?"+dt+"\" />"); 
				});
 			 });
  		</script>
</head>
<body>
<%
	if (request.getParameter("error") != null
			&& request.getParameter("error").equals("1")) {
%>
<span style="color: red"> 登录失败，请重试！ </span>
<%
	} else if (request.getParameter("error") != null
			&& request.getParameter("error").equals("3")) {
%>
<span style="color: red"> 系统发现您在别处登录！ </span>
<%
	} else if (request.getParameter("error") != null
			&& request.getParameter("error").equals("5")) {
%>
<span style="color: red"> 您输入的验证码不正确！ </span>
<%
	} else if (request.getParameter("error") != null
			&& request.getParameter("error").equals("7")) {
%>
<span style="color: red"> 会话超时，请重新登陆！ </span>
<%
	}
%>
<h2>示例</h2>
<form id="loginForm" action="${base}/j_spring_security_check"
	method="post">
<table class="inputView">
	<tr>
		<td>用户名:</td>
		<td><input id='username' type='text' name='j_username'
			class="required" /></td>
	</tr>
	<tr>
		<td>密码:</td>
		<td><input type='password' name='j_password' class="required" />
		</td>
	</tr>
	<tr>
		<td>验证码:</td>
		<td><input type='text' name='j_code' size=6 class="required" />
		<span id="verifypic"> <img border="0" src="${base}/code.jpg" /></span>
		</td>
	</tr>
	<tr>
		<td><input type="checkbox" name="_spring_security_remember_me"
			class="button" /></td>
		<td>三天内记住我</td>
	</tr>
	<tr>
		<td colspan='2'><input value="登录" type="submit" class="button" />
		</td>
	</tr>
</table>
</form>
<p>（校长<b>admin/admin</b> ,书记<b>admin2/admin2</b>）</p>
</body>
</html>

